﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DcsGauges.Gui.Gauges.ValueConverters
{
    class TwoLeverStateValueConverter : StateConverter<TwoLeverGauge.LeverState>
    {
        #region Constructors

        public TwoLeverStateValueConverter() 
            : base
            (
                convertFunction: (v) => 
                    {
                        if(v < 0.5f) return TwoLeverGauge.LeverState.State0; 
                        else         return TwoLeverGauge.LeverState.state1;
                    },
                convertBackFunction: (s) =>
                    {
                        if(s == TwoLeverGauge.LeverState.State0) return 0.0f;
                        else                                     return 1.0f;
                    }
            )
        {

        }

        #endregion
    }
}
